﻿@{
    Layout = "../Shared/_Layout.cshtml";
}

<div id="header">
    <div>
        <h2>找回密码</h2>
    </div>
</div>

<div class="container-fluid">
    <div class="wheelContainer">
        <form method="post" action="#">
            <div class="row-fluid">
                <div class="span12">
                    <div class="row-fluid">
                        <label for="txtEmail" class="span12">
                            Email：
                        <span class="icon16 icomoon-icon-user-3 right gray marginR10"></span>
                        </label>
                        <input type="email" placeholder="请输入您的Email" id="txtEmail" name="email" class="span12" tabindex="1" />
                    </div>
                    <div class="row-fluid" id="msg" style="display: none">
                        <div class="alert alert-error">
                            <b>错误：</b>
                            <span>用户名或密码错误</span>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="form-action">
                            <button id="loginBtn" class="btn btn-info right" type="submit" tabindex="4">
                                <span class="icon16 icomoon-icon-enter white"></span>
                                提 交
                            </button>
                        </div>
                    </div>

                </div>
            </div>
        </form>
    </div>
</div>

<div id="OkPanel" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-body">
        <p><b>密码重置的邮件已发送到您的邮箱。请尽快通过邮件中的链接，重设您的密码。</b></p>
    </div>
</div>

<script>
    $(function () {
        $("#loginBtn").click(function () {
            $("#msg").toggle(false);

            Whale.Remote.Operation({
                url: "/Accounts/User/SendPasswordMail",
                parameters: {
                    email: $("#txtEmail").val(),
                },
                success: function (response) {
                    //location.href = url;
                    $('#OkPanel').modal({})
                },
                error: function (msg) {
                    $("#msg div span").html(msg);
                    $("#msg").fadeIn();
                }
            });
            return false;
        });
    });
</script>